Skip to content

Use safer SQL query to guarantee column order#4459

Merged
jixuan1989 merged 1 commit intoapache:masterfrom
shunfan-shao:switch-to-safer-sql-query
Nov 24, 2021
Merged

Use safer SQL query to guarantee column order#4459
jixuan1989 merged 1 commit intoapache:masterfrom
shunfan-shao:switch-to-safer-sql-query

Conversation

@shunfan-shao
Copy link
Copy Markdown
Contributor

@shunfan-shao shunfan-shao commented Nov 24, 2021

Description

The test testSelectColumnStatementWithTimeFilter fails under NonDex tool which detects flakiness of usage with non-deterministic data structures. The failure behavior is defined by incorrect ordering of column data.

Reproduce

To reproduce:

mvn edu.illinois:nondex-maven-plugin:1.1.2:nondex 
    -pl zeppelin-interpreter 
    -Dtest=org.apache.zeppelin.iotdb.IoTDBInterpreterTest#testSelectColumnStatementWithTimeFilter  -DnondexRuns=10

Issue

I suspect the cause comes from the query, whereas * makes the result order inconsistent.

select * from root.test.wf01.wt01 where time > 2 and time < 6

From ResultSet Iterators - SAP:
Open SQL/SQLJ prohibits to process the result set of a SELECT * query with a positional iterator. The reason is that Open SQL does not guarantee the order of the columns. It may be different at runtime and at design time.


This PR has:

  • been self-reviewed.
    • concurrent read
    • concurrent write
    • concurrent read and write
  • added documentation for new or modified features or behaviors.
  • added Javadocs for most classes and all non-trivial methods.
  • added or updated version, license, or notice information
  • added comments explaining the "why" and the intent of the code wherever would not be obvious
    for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold
    for code coverage.
  • added integration tests.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, this is your first pull request in IoTDB project. Thanks for your contribution! IoTDB will be better because of you.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.009%) to 67.249% when pulling 33318c2 on shunfan-shao:switch-to-safer-sql-query into 14505c1 on apache:master.

@jixuan1989 jixuan1989 merged commit 1f853f1 into apache:master Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants